<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <label>请输入评论:</label><br>
    <textarea rows="8" cols="20" v-model="rate">{{rate}}</textarea>
    <button @click="addComment()">提交</button>
</div>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

<script>

    new Vue({
        el:'#app',
        data:{
            orderNum: window.location.href.split("?")[1].split("=")[1],
            rate:''
        },
        methods:{
            addComment:function () {
                axios.post("http://127.0.0.1/apx/addRate",{"rate":this.rate,"orderNum":this.orderNum}).then(
                    r=>{
                        alert(r.data);
                        location.href = "ShowOrder.html";
                    }
                )
            }
        }
    });
</script>

</body>
</html>